/* Calendar.scss */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap");

$primary-color: #1890ff;
$secondary-color: #f0f0f0;
$text-color: #333;
$light-text: #666;
$border-color: #e8e8e8;
$event-color: #ff4d4f;
$marketing-bg: #f9f9f9;
$other-month-color: #bfbfbf;
$weekend-color: #ff0000;
$hover-bg: #e6f7ff;

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.calendar-container {
  width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
}

.calendar-header {
  padding: 15px 20px;
  border-bottom: 1px solid $border-color;
  margin-bottom: 20px;

  .controls-container {
    display: flex;
    align-items: center;
  

    .year-selector {
      width: 100px;
      font-size: 24px;
      font-weight: 700;
      line-height: 1;

      .year-select {
        font-size: 24px;
        font-weight: 700;
        width: 100%;
        padding: 0;

        .ant-select-selector {
          border: none !important;
          padding: 0 !important;
          height: auto !important;
          background: transparent !important;
        }

        .ant-select-selection-item {
          font-size: 24px;
          font-weight: 700;
          padding: 0 !important;
        }
      }
    }

    .month-selector {
      display: flex;
      align-items: center;
      font-size: 16px;
      font-weight: 500;

      .current-month {
        margin: 0 15px;
        font-weight: 700;
      }

      .month-button {
        background: transparent;
        border: none;
        cursor: pointer;
        font-size: 14px;
        padding: 5px;
        color: $light-text;
        transition: color 0.2s;

        &:hover {
          color: $primary-color;
        }
      }
    }

    .reset-button {
      background: #f0f0f0;
      color: $text-color;
      border: 1px solid $border-color;
      border-radius: 4px;
      padding: 4px 12px;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s;

      &:hover {
        background: darken(#f0f0f0, 5%);
        color: $primary-color;
        border-color: $primary-color;
      }
    }
  }
}

.calendar-main {
  display: flex;
  padding: 0 15px 20px;
}

.calendar-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-right: 20px;
}

.week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid $border-color;

  .week-day {
    &:first-child {
      color: $weekend-color;
    }
    &:last-child {
      color: $weekend-color;
    }
  }
}

.week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid $border-color;

  &:last-child {
    border-bottom: none;
  }
}

.day-cell {
  min-height: 90px;
  padding: 10px;
  border-right: 1px solid $border-color;
  position: relative;

  &:last-child {
    border-right: none;
  }

  &:nth-child(1),
  &:nth-child(7) {
    .solar-date {
      color: $weekend-color;
    }
  }

  &.other-month {
    background-color: #fafafa;

    .solar-date,
    .lunar-date {
      color: #ccc;
    }
  }

  &:hover {
    background: $hover-bg;
  }
}

// 新增事件容器
.events-container {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
}

.solar-date {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
}

.lunar-date {
  font-size: 12px;
  color: $light-text;
  margin-bottom: 6px;
}

.event-marker {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  font-size: 11px;
  padding: 2px 5px;
  background-color: rgba($primary-color, 0.1);
  color: $primary-color;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;

  &:hover {
    background-color: rgba($primary-color, 0.2);
  }
  // 周末特殊样式
  &:nth-child(1),
  &:nth-child(7) {
    color: #ff4d4f;
    background-color: rgba(255, 77, 79, 0.1);

    &:hover {
      background-color: rgba(255, 77, 79, 0.2);
    }
  }
}

.marketing-events {
  width: 320px;
  background: #fff;
  border-radius: 4px;
  padding: 15px;
  border: 1px solid $border-color;
}

.events-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid $border-color;
}

.events-list {
  max-height: 550px;
  overflow-y: auto;
  padding-right: 5px;
}

.event-item {
 
  margin-bottom: 15px;
  padding-bottom: 15px;
 

  &:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
}

.event-header {
  display: flex;
 gap: 30%;
  align-items: center;
  margin-bottom: 5px;
}

.event-date {
  font-size: 14px;
  font-weight: 500;
  color: $light-text;
  min-width: auto; // 移除固定宽度
}
.event-days {
  font-size: 14px;
  
  color: #666;
  span{
    color: #1890ff;
  }
}

.event-names {
 
  width: 60%;
  height: 60px;
  background: #f5f7fb;
  padding: 10px;
  border-radius: 10px;
  color: #000;
  font-weight: bold;
}

.event-name {
  font-size: 14px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: color 0.2s;

  &:hover {
    color: $primary-color;
    text-decoration: underline;
  }

  &:last-child {
    margin-bottom: 0;
  }
}

// 选中样式
.ant-select-item-option-selected {
  background-color: rgba($primary-color, 0.1) !important;
}

// 响应式设计
@media (max-width: 1024px) {
  .calendar-container {
    width: 95%;
  }
}

@media (max-width: 768px) {
  .calendar-main {
    flex-direction: column;

    .calendar-grid {
      margin-right: 0;
      margin-bottom: 20px;
    }

    .marketing-events {
      width: 100%;
    }
  }

  .calendar-header .controls-container {
    flex-wrap: wrap;

    .year-selector {
      width: 100%;
      margin-bottom: 15px;
    }
  }
}
